/**
  \file main.qml
\brief The main source of the qml interface

\author © 2011 Enrico Miglino / Tech Consulting (enrico.miglino@ovi.com)
\author "Black Cat Cutting Studio" is protected by the copyright law
\author Distributed under the LGPL 3.0 license.
\version 1.0 alpha
\date 2011

\par Black Cat Cutting Studio licensing notes

    "Black Cat Cutting Studio" is free software: you can redistribute it
    and/or modify it under the terms of the Lesser GNU General Public License
    as published by the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    "Black Cat Cutting Studio" is distributed in the hope that it
    will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    Lesser GNU General Public License for more details.

    You should have received a copy of the Lesser GNU General Public License
    along with "Black Cat Cutting Studio".
    If not, see <http://www.gnu.org/licenses/>.

*/
import QtQuick 1.0
import "elements" 1.0 as BlackCat  // Components folder

Item {
    id: screen  // This is the main screen block

    // Configuration properties grouped in a single global item.
    BlackCat.Parameters {
        id: configuration

        // Screen size is the reference base for the program, so it is not
        // defined before but set the default parameter value used in all the program
        // for dynamic calculations.
        defaultScreenWidth: screen.width
        defaultScreenHeight: screen.height
    }

    // The application background
    BlackCat.Background {
        id: appBackground;

        width: screen.width;
        height: screen.height
        // Set height of the shadow bar on the size or the toolbar and text notification area
        shadowHeight: configuration.setShadowHeight()
        shadowWidth: screen.width
    }

    BlackCat.Workarea {
        id: graphicsWorkArea

        // Parametric dimension of the work area. The values are assigned to the object
        // when it is shown on the screen
        width: configuration.setLeftBottomSideWidth()
        height: configuration.setLeftBottomSideHeight();
        x: configuration.setBottomLeftX(width)
        y: configuration.setBottomLeftY(height)
    }

    // The color toolbar list definition: size, anchors and offset
    BlackCat.ColorModel {
        id: colors

        // Adapt the Color Toolbar to the screen size
        width: configuration.setRightBottomSideWidth();
        height: configuration.setRightBottomSideHeight();
        // Move the toolbar to the right position in the screen
        x: configuration.setBottomRightX(width)
        y: configuration.setBottomRightY(height)
    }

    // Top screen command toolbars
    BlackCat.Commandset1 {
        x: configuration.setToolbarX(1)
        y: configuration.setToolbarY(1)
    }

    // Top screen command toolbars
    BlackCat.Commandset2 {
        x: configuration.setToolbarX(2)
        y: configuration.setToolbarY(2)
    }

    // Top screen command toolbars
    BlackCat.Commandset3 {
        x: configuration.setToolbarX(3)
        y: configuration.setToolbarY(3)
    }

    // Top screen command toolbars
    BlackCat.Commandset4 {
        x: configuration.setToolbarX(4)
        y: configuration.setToolbarY(4)
    }

    // Top screen command toolbars
    BlackCat.Commandset5 {
        x: configuration.setToolbarX(5)
        y: configuration.setToolbarY(5)
    }

    // Timed splash screen on start
    BlackCat.Splash {
        id: splashstart;

        // Apply the scaling factor to the image
        width: screen.width * configuration.splashResize
        height: screen.height * configuration.splashResize
        anchors.horizontalCenter: screen.horizontalCenter
        anchors.verticalCenter: screen.verticalCenter

        // Initialize the timer.
        splashshowing: true
    }
}
